package br.com.fiap.trabalho.factory;

import br.com.fiap.trabalho.dao.ActorDAO;
import br.com.fiap.trabalho.dao.CategoryDAO;
import br.com.fiap.trabalho.dao.MovieDAO;
import br.com.fiap.trabalho.dao.StudioDAO;

public abstract class DaoFactory {

	public static final int JDBC = 1;
	public static final int JPA = 2;

	private static DaoFactory jdbcDAOFactory = null;
	private static DaoFactory jpaDAOFactory = null;

	public static DaoFactory getDaoFactory(final int daoFactoryType) {

		switch (daoFactoryType) {
		case JDBC:
			if (jdbcDAOFactory == null) {
				jdbcDAOFactory = new JDBCDaoFactory();
			}
			return jdbcDAOFactory;

		case JPA:
			if (jpaDAOFactory == null) {
				jpaDAOFactory = new JPADaoFactory();
			}
			return jpaDAOFactory;
		default:
			return null;
		}
	}

	public abstract ActorDAO getActorDAO();

	public abstract MovieDAO getMovieDAO();

	public abstract StudioDAO getStudioDAO();

	public abstract CategoryDAO getCategoryDAO();

}
